<template>
  <div class="box">
    <div class="top">
      <p class="title">实时游客统计</p>
      <p class="bg"></p>
      <p class="right">
        可预约总量
        <span>99999</span>
        人
      </p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="item">{{ item }}</span>
    </div>
    <div class="echarts" ref="charts">111</div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
import 'echarts-liquidfill'
let people = ref('282938人')
let charts = ref()
onMounted(() => {
  //获取使用echarts标签实例并初始化
  let mycharts = echarts.init(charts.value)
  //设置实例配置项
  mycharts.setOption({
    title: {
      text: '水球图',
    },
    series: {
      type: 'liquidFill',
      waveAnimation: true,
      animationDuration: 3,
      animationDurationUpdate: 0,
      data: [0.6, 0.2],
      radius: '80%', //水球图大小
    },
    grid: {
      top: 0,
      left: 0,
      bottom: 0,
      right: 0,
    },
  })
})
</script>

<style scoped lang="scss">
.box {
  background: url('../../images/dataScreen-main-lb.png') no-repeat;
  background-size: cover;
  margin-top: 10px;
  .top {
    margin-left: 20px;
    .title {
      color: white;
      font-size: 20px;
    }
    .bg {
      width: 68px;
      height: 7px;
      background: url('../../images/dataScreen-title.png') no-repeat;
      background-size: cover;
      margin-top: 10px;
    }
    .right {
      float: right;
      color: white;
    }
  }
  .number {
    padding: 10px;
    margin-top: 30px;
    display: flex;
    span {
      flex: 1;
      height: 97px;
      text-align: center;
      line-height: 97px;
      background: url('../../images/total.png') no-repeat;
      background-size: 100% 100%;
      color: #29fcff;
      font-size: 30px;
    }
  }
  .echarts {
    height: 60%;
    width: 250px;
    margin: auto;
  }
}
</style>
